Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation errors, upgrade Solidity #210

Closed
wants to merge 2 commits into from

Conversation

arjun-io
Copy link
Contributor

@arjun-io arjun-io commented Jul 8, 2022

Pulls in some changes from #208 to get the new GovernorBravoG2 contracts compileable, and updates the Solidity version to 0.8.15 (latest as of the time of this PR). There are a couple of breaking inheritance changes that required code changes here and here

});

proposals[newProposal.id] = newProposal;
Proposal storage newProposal = proposals[proposalCount];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect since it doesn't create a new proprosal, but only creates link to a previous one.
You can test this

Copy link
Contributor Author

@arjun-io arjun-io Aug 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your test is using memory structs while this is using storage. This is effectively creating a pointer to the struct at the array index in storage and modifying the fields there, not copying anything.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, nvm

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@@ -292,7 +296,15 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE
* @return If the account is whitelisted
*/
function isWhitelisted(address account) public view returns (bool) {
return (whitelistAccountExpirations[account] > now);
uint currentBlockTimestamp = getBlockTimestamp();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange idea, it would change nothing only making deployment gas cost increase.

@arjun-io arjun-io closed this Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants